home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
ab20
/
ab20_archive
/
utilities
/
emulators
/
transutils.lzh
/
start.asm
< prev
next >
Wrap
Assembly Source File
|
1991-01-27
|
1KB
|
72 lines
;
; start.asm - setup the starting condition of the registers
; for AmigaTransformer.
;
;
; We have the emulator copied into it's final resting position
; and now we have to set up some of the registers as the emulator
; expects to find them.
;
; a3 base of emulator text area (_text)
; a4 base of emulator data area (_data)
; a5 base of MS-DOS user area (_dos)
;
; d2 amount of data area used for emulator (_dsize)
; d3 amount of text area used for emulator (_tsize)
; d7 size of MS-DOS area (_dossize)
;
xdef _startup_text
xdef _movmem
xref _text
xref _data
xref _dos
xref _dsize
xref _tsize
xref _dossize
PRIVHNDLRSIZE equ $38
INSTALLERSIZE equ $10
cseg
_startup_text
move.l _text,a3
move.l _data,a4
move.l _dos,a5
move.l _dsize,d2
move.l _tsize,d3
move.l _dossize,d7
; We actually start by branching off to the code to install
; the privileged instruction handler.
jmp -INSTALLERSIZE(a3)
;
; movmem - move memory
;
; correctly handles overlapped moves
;
_movmem
movem.l 4(sp),a0/a1
move.l 12(sp),d0 ;fetch parameters
cmp.l a0,a1 ;see which direction to move
beq.s movend ; or if no move is necessary
bls forward
add.l d0,a0 ;move tail to tail
add.l d0,a1
reverse
move.b -(a0),-(a1)
subq.l #1,d0
bne reverse
movend
rts
;
forward ;move head to head
move.b (a0)+,(a1)+
subq.l #1,d0
bne forward
rts
end